//POJ 2187
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>

using namespace std;

const int maxn=50005;
struct Point{
    int x,y;
    Point(int x=0,int y=0):x(x),y(y){}
    const bool operator < (const Point &p) const;
    const Point operator - (const Point &p) const{return Point(x-p.x,y-p.y);}
};

inline int read(){
    int r;char c;bool f=0;
    for(c=getchar();c>'9'||c<'0';c=getchar()) if(c=='-') f=1;
    for(r=0;c<='9'&&c>='0';c=getchar()) r=r*10+c-'0';
    if(f) return -r;
    else return r;
}

Point pts[maxn];
int sta[maxn];

inline int cross(const Point &p,const Point &q){return p.x*q.y-p.y*q.x;}
inline int dis(const Point &p,const Point &q){return (p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y);}
const bool Point::operator < (const Point &p) const{
    int t=cross(*this-*pts,p-*pts);
    if(t==0) return dis(*this,*pts)<dis(p,*this);
    else return t>0;
}
inline int graham(const int &n){
    int k=0,top=0;
    for(int i=1;i<n;i++) if(pts[i].x<pts[k].x||(pts[i].x==pts[k].x&&pts[i].y<pts[k].y)) k=i;
    swap(pts[0],pts[k]);
    sort(pts+1,pts+n);
    top=2;sta[0]=0;sta[1]=1;
    for(int i=2;i<n;i++){
        while(top>1&&cross(pts[sta[top-1]]-pts[sta[top-2]],pts[i]-pts[sta[top-1]])<=0) top--;
        sta[top++]=i;
    }
    return top;
}
inline int area(const Point &p,const Point &q,const Point &r){return cross(q-p,r-p);}
inline int RC(const int &n,const int &top){
    int ans=0,q=1;
    sta[top]=sta[0];
    for(int i=0;i<top;i++){
        while(area(pts[sta[i]],pts[sta[i+1]],pts[sta[q]])<area(pts[sta[i]],pts[sta[i+1]],pts[sta[q+1]])) q++,q%=top;
        ans=max(ans,dis(pts[sta[i]],pts[sta[q]]));
    }
    return ans;
}

int main(){
    int n;
    int top;
    n=read();
    for(int i=0;i<n;i++){
        pts[i].x=read();pts[i].y=read();
    }
    printf("%d\n",RC(n,top=graham(n)));
    //for(int i=0;i<top;i++) printf("(%d,%d)\n",pts[sta[i]].x,pts[sta[i]].y);
    return 0;
}
